New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for AWS_DEFAULT_PROFILE env variable when resolving profile #8354
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8354 +/- ##
=========================================
Coverage ? 88.08%
=========================================
Files ? 249
Lines ? 9309
Branches ? 0
=========================================
Hits ? 8200
Misses ? 1109
Partials ? 0
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @marekpiotrowski !
@medikoo @marekpiotrowski This seems to have been removed, the docs only mention |
@OJFord I assume docs were never updated with info that |
It's not a docs issue, it's not working. |
iirc (and if I read my comment correctly) |
I'd say it works fine:
obviously, I do not have valid AWS credentials, but it resolved the profile correctly. |
same after installing from sources, even added a printout of the credentials which are selected
|
I meant that setting AWS_PROFILE to the same value as it works as expected (well, progressing anyway..), not giving the error I had with it unset and only AWS_DEFAULT_PROFILE set. |
Closes: #7676
By default, aws-cli does not take [default] profile from credentials file if
AWS_DEFAULT_PROFILE
environment variable is defined. Serverless should behave in exactly same manner when resolving profiles - currently [default] is hard-coded. Fallback mechanism to [default] is still there ifAWS_DEFAULT_PROFILE
isn't defined.Important remark 1: each test in
getCredentials
suite seems to carry some state, that's why I had to resetnewAwsProvider.options['aws-profile']
, below is an interesting log before introducing my changes at all:logs correspond to the following:
even though
newAwsProvider
is instantiated before each test. Maybe it'd be worth investigating, not sure.Important remark 2: (okay, less important) there's a typo in few tests names ("provied"). Not sure if I should fix it in the same pull request?